<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 1.5.8">
<title>SCRIPTS</title>
<link rel="stylesheet" href="css/spring.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body class="book toc2 toc-left">
<div id="header">
<h1>SCRIPTS</h1>
<div id="toc" class="toc2">
<div id="toctitle">Table of Contents</div>
<ul class="sectlevel0">
<li><a href="#pipeline-sh1">pipeline.sh(1)</a>
<ul class="sectlevel1">
<li><a href="#name">NAME</a></li>
<li><a href="#synopsis">SYNOPSIS</a></li>
<li><a href="#functions">FUNCTIONS</a></li>
<li><a href="#details">DETAILS</a>
<ul class="sectlevel2">
<li><a href="#script-body">Script Body</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#generate-settings-sh1">generate-settings.sh(1)</a>
<ul class="sectlevel1">
<li><a href="#name-2">NAME</a></li>
<li><a href="#synopsis-2">SYNOPSIS</a></li>
<li><a href="#functions-2">FUNCTIONS</a></li>
<li><a href="#details-2">DETAILS</a>
<ul class="sectlevel2">
<li><a href="#script-body-2">Script Body</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#resource-utils-sh1">resource-utils.sh(1)</a>
<ul class="sectlevel1">
<li><a href="#name-3">NAME</a></li>
<li><a href="#synopsis-3">SYNOPSIS</a></li>
<li><a href="#functions-3">FUNCTIONS</a></li>
<li><a href="#details-3">DETAILS</a>
<ul class="sectlevel2">
<li><a href="#script-body-3">Script Body</a></li>
<li><a href="#exportkeyvalproperties">exportKeyValProperties</a></li>
<li><a href="#load_pubkey">load_pubkey</a></li>
<li><a href="#passkeyvalproperties">passKeyValProperties</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#task-sh1">task.sh(1)</a>
<ul class="sectlevel1">
<li><a href="#name-4">NAME</a></li>
<li><a href="#synopsis-4">SYNOPSIS</a></li>
<li><a href="#functions-4">FUNCTIONS</a></li>
<li><a href="#details-4">DETAILS</a>
<ul class="sectlevel2">
<li><a href="#script-body-4">Script Body</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#task-sh1-2">task.sh(1)</a>
<ul class="sectlevel1">
<li><a href="#name-5">NAME</a></li>
<li><a href="#synopsis-5">SYNOPSIS</a></li>
<li><a href="#functions-5">FUNCTIONS</a></li>
<li><a href="#details-5">DETAILS</a>
<ul class="sectlevel2">
<li><a href="#script-body-5">Script Body</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#task-sh1-3">task.sh(1)</a>
<ul class="sectlevel1">
<li><a href="#name-6">NAME</a></li>
<li><a href="#synopsis-6">SYNOPSIS</a></li>
<li><a href="#functions-6">FUNCTIONS</a></li>
<li><a href="#details-6">DETAILS</a>
<ul class="sectlevel2">
<li><a href="#script-body-6">Script Body</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#task-sh1-4">task.sh(1)</a>
<ul class="sectlevel1">
<li><a href="#name-7">NAME</a></li>
<li><a href="#synopsis-7">SYNOPSIS</a></li>
<li><a href="#functions-7">FUNCTIONS</a></li>
<li><a href="#details-7">DETAILS</a>
<ul class="sectlevel2">
<li><a href="#script-body-7">Script Body</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#task-sh1-5">task.sh(1)</a>
<ul class="sectlevel1">
<li><a href="#name-8">NAME</a></li>
<li><a href="#synopsis-8">SYNOPSIS</a></li>
<li><a href="#functions-8">FUNCTIONS</a></li>
<li><a href="#details-8">DETAILS</a>
<ul class="sectlevel2">
<li><a href="#script-body-8">Script Body</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div id="content">
<h1 id="pipeline-sh1" class="sect0"><a class="link" href="#pipeline-sh1">pipeline.sh(1)</a></h1>
<div class="sect1">
<h2 id="name"><a class="link" href="#name">NAME</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>pipeline.sh - a shell script</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="synopsis"><a class="link" href="#synopsis">SYNOPSIS</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>Contains default setup for all Concourse scripts.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Copies the Cloud Pipelines Scripts to a subfolder of the repository to reference it in further steps.</p>
</li>
<li>
<p>Sources Concourse scripts utility functions</p>
</li>
<li>
<p>References variables from the key-value Concourse resource</p>
</li>
<li>
<p>Generates required settings.xml / gradle.properties values</p>
</li>
<li>
<p>Sources pipeline.sh script from Cloud Pipelines Scripts</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="functions"><a class="link" href="#functions">FUNCTIONS</a></h2>
<div class="sectionbody">

</div>
</div>
<div class="sect1">
<h2 id="details"><a class="link" href="#details">DETAILS</a></h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="script-body"><a class="link" href="#script-body">Script Body</a></h3>
<div class="paragraph">
<p>Has 43 line(s). Calls functions:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>Script-Body
`-- resource-utils.sh/exportKeyValProperties</pre>
</div>
</div>
<div class="paragraph">
<p>Uses feature(s): <em>export</em>, <em>source</em></p>
</div>
<div class="paragraph">
<p><em>Exports (environment):</em> CI <strong class="big">//</strong> LATEST_PROD_TAG <strong class="big">//</strong> PIPELINE_VERSION <strong class="big">//</strong> SCRIPTS_OUTPUT_FOLDER <strong class="big">//</strong> TERM</p>
</div>
</div>
</div>
</div>
<h1 id="generate-settings-sh1" class="sect0"><a class="link" href="#generate-settings-sh1">generate-settings.sh(1)</a></h1>
<div class="sect1">
<h2 id="name-2"><a class="link" href="#name-2">NAME</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>generate-settings.sh - a shell script</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="synopsis-2"><a class="link" href="#synopsis-2">SYNOPSIS</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>Generates settings.xml and gradle.properties#</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="functions-2"><a class="link" href="#functions-2">FUNCTIONS</a></h2>
<div class="sectionbody">

</div>
</div>
<div class="sect1">
<h2 id="details-2"><a class="link" href="#details-2">DETAILS</a></h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="script-body-2"><a class="link" href="#script-body-2">Script Body</a></h3>
<div class="paragraph">
<p>Has 42 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.).</p>
</div>
</div>
</div>
</div>
<h1 id="resource-utils-sh1" class="sect0"><a class="link" href="#resource-utils-sh1">resource-utils.sh(1)</a></h1>
<div class="sect1">
<h2 id="name-3"><a class="link" href="#name-3">NAME</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>resource-utils.sh - a shell script</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="synopsis-3"><a class="link" href="#synopsis-3">SYNOPSIS</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>Contains</p>
</div>
<div class="ulist">
<ul>
<li>
<p>utility functions required by the key-value Concourse resource.</p>
</li>
<li>
<p>functions for setting up the ssh agent</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="functions-3"><a class="link" href="#functions-3">FUNCTIONS</a></h2>
<div class="sectionbody">
<div class="literalblock">
<div class="content">
<pre>exportKeyValProperties
load_pubkey
passKeyValProperties</pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="details-3"><a class="link" href="#details-3">DETAILS</a></h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="script-body-3"><a class="link" href="#script-body-3">Script Body</a></h3>
<div class="paragraph">
<p>Has 10 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.).</p>
</div>
<div class="paragraph">
<p>Uses feature(s): <em>export</em></p>
</div>
<div class="paragraph">
<p><em>Exports (environment):</em> SSH_AGENT_BIN <strong class="big">//</strong> TEST_MODE <strong class="big">//</strong> TMPDIR</p>
</div>
</div>
<div class="sect2">
<h3 id="exportkeyvalproperties"><a class="link" href="#exportkeyvalproperties">exportKeyValProperties</a></h3>
<div class="quoteblock">
<blockquote>
<div class="literalblock">
<div class="content">
<pre># Reads all key-value pairs in keyval.properties input file and exports them as env vars</pre>
</div>
</div>
</blockquote>
</div>
<div class="paragraph">
<p>Has 14 line(s). Doesn&#8217;t call other functions.</p>
</div>
<div class="paragraph">
<p>Uses feature(s): <em>export</em></p>
</div>
<div class="paragraph">
<p>Called by:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>pipeline.sh/Script-Body</pre>
</div>
</div>
<div class="paragraph">
<p><em>Environment variables used:</em> task.sh &#8594; KEYVAL_RESOURCE <strong class="big">//</strong> task.sh &#8594; ROOT_FOLDER</p>
</div>
</div>
<div class="sect2">
<h3 id="load_pubkey"><a class="link" href="#load_pubkey">load_pubkey</a></h3>
<div class="quoteblock">
<blockquote>
<div class="literalblock">
<div class="content">
<pre># Loads git key - needed for prod-rollback to delete prod tag after rollback</pre>
</div>
</div>
</blockquote>
</div>
<div class="paragraph">
<p>Has 22 line(s). Doesn&#8217;t call other functions.</p>
</div>
<div class="paragraph">
<p>Uses feature(s): <em>eval</em>, <em>trap</em></p>
</div>
<div class="paragraph">
<p>Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).</p>
</div>
<div class="paragraph">
<p><em>Environment variables used:</em> SSH_AGENT_BIN <strong class="big">//</strong> TEST_MODE <strong class="big">//</strong> TMPDIR</p>
</div>
</div>
<div class="sect2">
<h3 id="passkeyvalproperties"><a class="link" href="#passkeyvalproperties">passKeyValProperties</a></h3>
<div class="quoteblock">
<blockquote>
<div class="literalblock">
<div class="content">
<pre># Writes all env vars that begin with PASSED_ to the keyval.properties output file</pre>
</div>
</div>
</blockquote>
</div>
<div class="paragraph">
<p>Has 13 line(s). Doesn&#8217;t call other functions.</p>
</div>
<div class="paragraph">
<p>Called by:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>task.sh/\]</pre>
</div>
</div>
<div class="paragraph">
<p><em>Environment variables used:</em> task.sh &#8594; KEYVALOUTPUT_RESOURCE <strong class="big">//</strong> task.sh &#8594; ROOT_FOLDER</p>
</div>
</div>
</div>
</div>
<h1 id="task-sh1" class="sect0"><a class="link" href="#task-sh1">task.sh(1)</a></h1>
<div class="sect1">
<h2 id="name-4"><a class="link" href="#name-4">NAME</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>task.sh - a shell script</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="synopsis-4"><a class="link" href="#synopsis-4">SYNOPSIS</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>Contains default setup for a generic Cloud Pipelines Concourse step</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Sources the default setup for all Cloud Pipelines Concourse scripts</p>
</li>
<li>
<p>Executes the passed script to run</p>
</li>
<li>
<p>Passes properties via key-value Concourse resource</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="functions-4"><a class="link" href="#functions-4">FUNCTIONS</a></h2>
<div class="sectionbody">

</div>
</div>
<div class="sect1">
<h2 id="details-4"><a class="link" href="#details-4">DETAILS</a></h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="script-body-4"><a class="link" href="#script-body-4">Script Body</a></h3>
<div class="paragraph">
<p>Has 22 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.).</p>
</div>
<div class="paragraph">
<p>Uses feature(s): <em>export</em>, <em>source</em></p>
</div>
<div class="paragraph">
<p><em>Exports (environment):</em> CONCOURSE_SCRIPTS_RESOURCE <strong class="big">//</strong> KEYVALOUTPUT_RESOURCE <strong class="big">//</strong> KEYVAL_RESOURCE <strong class="big">//</strong> OUTPUT_RESOURCE <strong class="big">//</strong> REPO_RESOURCE <strong class="big">//</strong> ROOT_FOLDER <strong class="big">//</strong> SCRIPTS_RESOURCE</p>
</div>
</div>
</div>
</div>
<h1 id="task-sh1-2" class="sect0"><a class="link" href="#task-sh1-2">task.sh(1)</a></h1>
<div class="sect1">
<h2 id="name-5"><a class="link" href="#name-5">NAME</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>task.sh - a shell script</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="synopsis-5"><a class="link" href="#synopsis-5">SYNOPSIS</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>Generates and commits a version and passes it to the Concourse key-value resource.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="functions-5"><a class="link" href="#functions-5">FUNCTIONS</a></h2>
<div class="sectionbody">

</div>
</div>
<div class="sect1">
<h2 id="details-5"><a class="link" href="#details-5">DETAILS</a></h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="script-body-5"><a class="link" href="#script-body-5">Script Body</a></h3>
<div class="paragraph">
<p>Has 34 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.).</p>
</div>
<div class="paragraph">
<p>Uses feature(s): <em>export</em></p>
</div>
<div class="paragraph">
<p><em>Exports (environment):</em> GIT_BIN <strong class="big">//</strong> KEYVALOUTPUT_RESOURCE <strong class="big">//</strong> ROOT_FOLDER</p>
</div>
</div>
</div>
</div>
<h1 id="task-sh1-3" class="sect0"><a class="link" href="#task-sh1-3">task.sh(1)</a></h1>
<div class="sect1">
<h2 id="name-6"><a class="link" href="#name-6">NAME</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>task.sh - a shell script</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="synopsis-6"><a class="link" href="#synopsis-6">SYNOPSIS</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>This script:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Retrieves the latest production tag</p>
</li>
<li>
<p>Calls api compatibility step</p>
</li>
<li>
<p>Calls build and upload step</p>
</li>
<li>
<p>Commits a tag with pipeline version</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="functions-6"><a class="link" href="#functions-6">FUNCTIONS</a></h2>
<div class="sectionbody">

</div>
</div>
<div class="sect1">
<h2 id="details-6"><a class="link" href="#details-6">DETAILS</a></h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="script-body-6"><a class="link" href="#script-body-6">Script Body</a></h3>
<div class="paragraph">
<p>Has 22 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.).</p>
</div>
<div class="paragraph">
<p>Uses feature(s): <em>export</em>, <em>source</em></p>
</div>
<div class="paragraph">
<p><em>Exports (environment):</em> CONCOURSE_SCRIPTS_RESOURCE <strong class="big">//</strong> KEYVALOUTPUT_RESOURCE <strong class="big">//</strong> KEYVAL_RESOURCE <strong class="big">//</strong> OUTPUT_RESOURCE <strong class="big">//</strong> REPO_RESOURCE <strong class="big">//</strong> ROOT_FOLDER <strong class="big">//</strong> SCRIPTS_RESOURCE</p>
</div>
</div>
</div>
</div>
<h1 id="task-sh1-4" class="sect0"><a class="link" href="#task-sh1-4">task.sh(1)</a></h1>
<div class="sect1">
<h2 id="name-7"><a class="link" href="#name-7">NAME</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>task.sh - a shell script</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="synopsis-7"><a class="link" href="#synopsis-7">SYNOPSIS</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>This script:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Sources default Cloud Pipelines Concourse scripts setup</p>
</li>
<li>
<p>Loads all git related functionality to allow tag manipulation</p>
</li>
<li>
<p>Calls the production deployment script of Cloud Pipelines script</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="functions-7"><a class="link" href="#functions-7">FUNCTIONS</a></h2>
<div class="sectionbody">

</div>
</div>
<div class="sect1">
<h2 id="details-7"><a class="link" href="#details-7">DETAILS</a></h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="script-body-7"><a class="link" href="#script-body-7">Script Body</a></h3>
<div class="paragraph">
<p>Has 22 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.).</p>
</div>
<div class="paragraph">
<p>Uses feature(s): <em>export</em>, <em>source</em></p>
</div>
<div class="paragraph">
<p><em>Exports (environment):</em> CONCOURSE_SCRIPTS_RESOURCE <strong class="big">//</strong> KEYVALOUTPUT_RESOURCE <strong class="big">//</strong> KEYVAL_RESOURCE <strong class="big">//</strong> OUTPUT_RESOURCE <strong class="big">//</strong> REPO_RESOURCE <strong class="big">//</strong> ROOT_FOLDER <strong class="big">//</strong> SCRIPTS_RESOURCE</p>
</div>
</div>
</div>
</div>
<h1 id="task-sh1-5" class="sect0"><a class="link" href="#task-sh1-5">task.sh(1)</a></h1>
<div class="sect1">
<h2 id="name-8"><a class="link" href="#name-8">NAME</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>task.sh - a shell script</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="synopsis-8"><a class="link" href="#synopsis-8">SYNOPSIS</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>This script:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Sources default Cloud Pipelines Concourse scripts setup</p>
</li>
<li>
<p>Loads all git related functionality to allow tag manipulation</p>
</li>
<li>
<p>Calls the production rollback script of Cloud Pipelines script</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="functions-8"><a class="link" href="#functions-8">FUNCTIONS</a></h2>
<div class="sectionbody">

</div>
</div>
<div class="sect1">
<h2 id="details-8"><a class="link" href="#details-8">DETAILS</a></h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="script-body-8"><a class="link" href="#script-body-8">Script Body</a></h3>
<div class="paragraph">
<p>Has 22 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.).</p>
</div>
<div class="paragraph">
<p>Uses feature(s): <em>export</em>, <em>source</em></p>
</div>
<div class="paragraph">
<p><em>Exports (environment):</em> CONCOURSE_SCRIPTS_RESOURCE <strong class="big">//</strong> KEYVALOUTPUT_RESOURCE <strong class="big">//</strong> KEYVAL_RESOURCE <strong class="big">//</strong> OUTPUT_RESOURCE <strong class="big">//</strong> REPO_RESOURCE <strong class="big">//</strong> ROOT_FOLDER <strong class="big">//</strong> SCRIPTS_RESOURCE</p>
</div>
</div>
</div>
</div>
</div>
<link rel="stylesheet" href="js/highlight/styles/atom-one-dark-reasonable.min.css">
<script src="js/highlight/highlight.min.js"></script>
<script>hljs.initHighlighting()</script>
</body>
</html>